<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .container{
      display: flex;
      align-items: center;
      width: 80%;
      margin: 0 auto;
      height: 700px;
    }
    .panel{
      /* width: 50px;
      height: 300px; */
      flex: 0.5;
      height: 60vh;
      border-radius: 50px;
      margin: 10px;
      transition: all 700ms ease;
      cursor: pointer;
      background-repeat: no-repeat;
      background-size: cover;
    }
    .active{
      /* width: 500px; */
      flex: 5;
      transition: width 700ms ease;
    }
    @media (max-width:680px){
      .container{
        width: 100vw;
      }
      .panel:nth-of-type(4),
      .panel:nth-of-type(5){
        display: none;
      }
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="panel active" style="background-image: url(https://tse3-mm.cn.bing.net/th/id/OIP-C.R9eSDM7P5zQ9sgIR7ZxS5QHaFp?w=240&h=183&c=7&r=0&o=5&dpr=1.6&pid=1.7);"></div>
    <div class="panel" style="background-image: url(https://tse2-mm.cn.bing.net/th/id/OIP-C._mnxq2Lgkx_bdGQ3laxIggHaFo?w=221&h=180&c=7&r=0&o=5&dpr=1.6&pid=1.7);"></div>
    <div class="panel" style="background-image: url(https://ts2.cn.mm.bing.net/th?id=OIP-C.i3eP2GhMytp7LlbsSxhzVQHaIe&w=233&h=267&c=8&rs=1&qlt=90&o=6&dpr=1.6&pid=3.1&rm=2);"></div>
    <div class="panel" style="background-image: url(https://img0.baidu.com/it/u=1385127238,1865479479&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500);"></div>
    <div class="panel" style="background-image: url(https://ts1.cn.mm.bing.net/th?id=OIP-C.W4IOb208Cph3X9oXbKFiuQHaIM&w=142&h=157&c=8&rs=1&qlt=90&o=6&dpr=1.6&pid=3.1&rm=2);"></div>
  </div>
  <script>
    var panels=document.querySelectorAll('.panel')
    panels.forEach(ele=>{
      ele.onclick=function(){
        for(var i=0;i<panels.length;i++){
          panels[i].classList.remove('active')
        }
        this.classList.add('active')
      }
    })
  </script>
</body>
</html>